using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._KML
{
    /// <summary>
    /// <para>Map To KML</para>
    /// <para>Converts a map to a KML file containing geometries and symbology. The output file is compressed using ZIP compression, has a .kmz extension, and can be read by any KML client including ArcGIS Earth and Google Earth.</para>
    /// <para>将地图转换为包含几何和符号系统的 KML 文件。输出文件使用 ZIP 压缩进行压缩，扩展名为 .kmz，可由任何 KML 客户端读取，包括 ArcGIS Earth 和 Google Earth。</para>
    /// </summary>    
    [DisplayName("Map To KML")]
    public class MapToKML : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MapToKML()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_map">
        /// <para>Input Map</para>
        /// <para>The map, scene or basemap to convert to KML.</para>
        /// <para>要转换为 KML 的地图、场景或底图。</para>
        /// </param>
        /// <param name="_out_kmz_file">
        /// <para>Output File</para>
        /// <para>The output KML file. This file is compressed and has a .kmz extension. The file can be read by any KML client including ArcGIS Earth and Google Earth.</para>
        /// <para>输出 KML 文件。此文件经过压缩，扩展名为 .kmz。任何 KML 客户端（包括 ArcGIS Earth 和 Google Earth）都可以读取该文件。</para>
        /// </param>
        public MapToKML(object _in_map, object _out_kmz_file)
        {
            this._in_map = _in_map;
            this._out_kmz_file = _out_kmz_file;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Map To KML";

        public override string CallName => "conversion.MapToKML";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_map, _out_kmz_file, _map_output_scale, _is_composite.GetGPValue(), _is_vector_to_raster.GetGPValue(), _extent_to_export, _image_size, _dpi_of_client, _ignore_zvalue.GetGPValue()];

        /// <summary>
        /// <para>Input Map</para>
        /// <para>The map, scene or basemap to convert to KML.</para>
        /// <para>要转换为 KML 的地图、场景或底图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Map")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_map { get; set; }


        /// <summary>
        /// <para>Output File</para>
        /// <para>The output KML file. This file is compressed and has a .kmz extension. The file can be read by any KML client including ArcGIS Earth and Google Earth.</para>
        /// <para>输出 KML 文件。此文件经过压缩，扩展名为 .kmz。任何 KML 客户端（包括 ArcGIS Earth 和 Google Earth）都可以读取该文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_kmz_file { get; set; }


        /// <summary>
        /// <para>Map Output Scale</para>
        /// <para><xdoc>
        ///   <para>The scale at which to export each layer in the map.</para>
        ///   <para>This parameter is important with any scale dependency, such as layer visibility or scale-dependent rendering. If the layer is not visible at the output scale, it is not included in the output KML. Any value, such as 1, can be used if there are no scale dependencies.</para>
        ///   <para>For raster layers, a value of 0 can be used to create one untiled output image. If a value greater than or equal to 1 is used, it determines the output resolution of the raster. This parameter has no effect on layers that are not raster layers.</para>
        ///   <para>Only numeric characters are accepted; for example, enter 20000 as the scale, not 1:20000. In languages that use commas as the decimal point, 20,000 is also acceptable.</para>
        ///   <para>If you're exporting a layer that is to be displayed as 3D vectors and the Return single composite image parameter is checked, you can set this parameter to any value as long as your features do not have any scale-dependent rendering.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于导出地图中每个图层的比例。</para>
        ///   <para>此参数对于任何比例依赖性（例如图层可见性或与比例相关的渲染）都很重要。如果图层在输出比例下不可见，则该图层不会包含在输出 KML 中。如果没有小数位数依赖关系，则可以使用任何值（如 1）。</para>
        ///   <para>对于栅格图层，值 0 可用于创建一个未平铺的输出影像。如果使用的值大于或等于 1，则确定栅格的输出分辨率。此参数对非栅格图层的图层没有影响。</para>
        ///   <para>只接受数字字符;例如，输入 20000 作为比例，而不是 1：20000。在使用逗号作为小数点的语言中，20,000 也是可以接受的。</para>
        ///   <para>如果要导出要显示为 3D 矢量的图层，并且选中了返回单个合成影像参数，则只要要素没有任何与比例相关的渲染，就可以将此参数设置为任意值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Map Output Scale")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _map_output_scale { get; set; } = 0;


        /// <summary>
        /// <para>Return single composite image</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output KML contains a single composite image or separate layers.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The output KML contains a single image that composites all the features in the map into a single raster image. The raster is draped over the terrain as a KML GroundOverlay. This option reduces the size of the output KML file. When you choose this option, individual features and layers in the KML are not selectable.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The output KML contains separate, individual layers. This is the default. Whether the layers are returned as rasters or as a combination of vectors and rasters is determined by the Convert Vector to Raster parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出 KML 是包含单个复合影像还是单独的图层。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出 KML 包含单个影像，该影像将地图中的所有要素合成为单个栅格影像。栅格将作为 KML GroundOverlay 覆盖在地形上。此选项可减小输出 KML 文件的大小。选择此选项时，KML 中的单个要素和图层不可选择。</bullet_item><para/>
        ///     <bullet_item>未选中 - 输出 KML 包含单独的单个图层。这是默认设置。图层是作为栅格返回还是作为矢量和栅格的组合返回，由将矢量转换为栅格参数确定。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Return single composite image")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_composite_value _is_composite { get; set; } = _is_composite_value._false;

        public enum _is_composite_value
        {
            /// <summary>
            /// <para>COMPOSITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("COMPOSITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_COMPOSITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_COMPOSITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Convert Vector to Raster</para>
        /// <para><xdoc>
        ///   <para>Specifies whether each vector layer in the map is converted to a separate raster image or preserved as vector layers.</para>
        ///   <para>This parameter is inactive if the Return single composite image parameter is checked.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Vector layers are converted to a separate raster image in the KML output. Normal raster layers are also added to the KML output. Each output KML raster layer is selectable, and its transparency can be adjusted in certain KML clients.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Vector layers are preserved as KML vectors. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是将地图中的每个矢量图层转换为单独的栅格图像还是保留为矢量图层。</para>
        ///   <para>如果选中了返回单个合成图像参数，则此参数处于非活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 矢量图层将在 KML 输出中转换为单独的栅格影像。普通栅格图层也会添加到 KML 输出中。每个输出 KML 栅格图层都是可选的，并且可以在某些 KML 客户端中调整其透明度。</bullet_item><para/>
        ///     <bullet_item>未选中 - 矢量图层将保留为 KML 矢量。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Convert Vector to Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_vector_to_raster_value _is_vector_to_raster { get; set; } = _is_vector_to_raster_value._false;

        public enum _is_vector_to_raster_value
        {
            /// <summary>
            /// <para>VECTOR_TO_IMAGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("VECTOR_TO_IMAGE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>VECTOR_TO_VECTOR</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("VECTOR_TO_VECTOR")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Extent to Export</para>
        /// <para><xdoc>
        ///   <para>The geographic extent of the area to be exported. Specify the extent rectangle bounds as a space-delimited string of WGS84 geographic coordinates in the form left lower right upper (x-min, y-min, x-max, y-max).</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the data frame or visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要出口的区域的地理范围。将范围矩形边界指定为以空格分隔的 WGS84 地理坐标字符串，格式为左下右上 （x-min、y-min、x-max、y-max）。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于数据框或可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent to Export")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent_to_export { get; set; } = null;


        /// <summary>
        /// <para>Size of returned image (pixels)</para>
        /// <para>The size of the tiles for raster layers if the Map Output Scale parameter value is set to a value greater than or equal to 1. This parameter only has an effect on raster layers.</para>
        /// <para>如果地图输出比例参数值设置为大于或等于 1 的值，则栅格图层的切片大小。此参数仅对栅格图层有影响。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Size of returned image (pixels)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _image_size { get; set; } = 1024;


        /// <summary>
        /// <para>DPI of output image</para>
        /// <para>The device resolution for any rasters in the output KML document. Typical screen resolution is 96 dpi. If the data in your map supports a high resolution and your KML requires it, consider increasing the value. Use this parameter with the Size of returned image (pixels) parameter to control output image resolution. The default value is 96.</para>
        /// <para>输出 KML 文档中任何栅格的设备分辨率。典型的屏幕分辨率为 96 dpi。如果地图中的数据支持高分辨率，并且 KML 需要高分辨率，请考虑增加该值。将此参数与返回图像的大小（像素）参数一起使用可控制输出图像分辨率。默认值为 96。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("DPI of output image")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _dpi_of_client { get; set; } = 96;


        /// <summary>
        /// <para>Clamped features to ground</para>
        /// <para><xdoc>
        ///   <para>Specifies whether features are clamped to the ground.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The z-values of the input features are overridden and KML is created with the features clamped to the ground. The features are draped over the terrain. This option is used for features that do not have z-values. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The z-values of the input features are used when creating KML. The features are drawn inside KML clients relative to sea level.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将特征夹紧到地面。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将覆盖输入要素的 z 值，并在将要素固定到地面上的情况下创建 KML。这些要素覆盖在地形上。此选项用于没有 z 值的要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 创建 KML 时将使用输入要素的 z 值。这些要素是在 KML 客户端中相对于海平面绘制的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clamped features to ground")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_zvalue_value _ignore_zvalue { get; set; } = _ignore_zvalue_value._true;

        public enum _ignore_zvalue_value
        {
            /// <summary>
            /// <para>CLAMPED_TO_GROUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLAMPED_TO_GROUND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ABSOLUTE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABSOLUTE")]
            [GPEnumValue("false")]
            _false,

        }

        public MapToKML SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}